package com.weixin.controller;


import com.weixin.entity.Department;
import com.weixin.service.IDepartmentService;
import com.weixin.uitl.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gpf
 * @since 2018-12-24
 */
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private IDepartmentService departmentService;

    @GetMapping("/list")
    public R listAll(){
        List<Department> departmentList = departmentService.list();

        return R.ok().put("departmentList",departmentList);
    }
}
